package com.garlicts.framework.base.page;

import java.io.Serializable;
import java.util.List;

public class PageResultDTO<T> implements Serializable {

	private static final long serialVersionUID = -9014155605607118793L;

	private int pageNo;
	private int pageSize;
	private int totalPages;
	private int totalCount;
	private List<T> list;
	@SuppressWarnings("unused")
	private int hasNext;
	@SuppressWarnings("unused")
	private int nextPageNo;

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalPages() {
		return totalPages;
	}

	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public int getHasNext() {
		return this.totalCount - this.pageNo * this.pageSize > 0 ? 1 : 0;
	}

	public void setHasNext(int hasNext) {
		this.hasNext = hasNext;
	}

	public int getNextPageNo() {
		return this.getHasNext() == 1 ? this.pageNo + 1 : this.pageNo;
	}

	public void setNextPageNo(int nextPageNo) {
		this.nextPageNo = nextPageNo;
	}

}
